import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * Write a description of class virus here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class virus extends Actor
{
    private int count=0;
    /**
     * Act - do whatever the virus wants to do. This method is called whenever
     * the 'Act' or 'Run' button gets pressed in the environment.
     */
    public void act() 
    {
        setLocation(getX()-2, getY());
        turn(1);
        eat2();
        if (getX() == 0) 
        {
            getWorld().removeObject(this);
        }// Add your action code here.
    }   
    
    /**
     * Constructor. Nothing to do so far.
     */
    public virus()
    {
    }
    
    public void eat2(){
        if(isTouching(WhiteCell.class)){
          removeTouching(WhiteCell.class);
          count=count-10;
          Bloodstream w=(Bloodstream)getWorld();
          w.showScore(count);
          Greenfoot.playSound("slurp.wav");
        }
    }
}
